<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>记录ABAP开发的日常——标准程序模板 | Gjboy</title><meta name="keywords" content="ABAP PROGRAM 模板"><meta name="author" content="ZyhCs"><meta name="copyright" content="ZyhCs"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="分享一个ABAP程序编写标准模板，让你的程序变得更加规范，更加具有可读性。"><meta property="og:type" content="article"><meta property="og:title" content="记录ABAP开发的日常——标准程序模板"><meta property="og:url" content="http://zyhcs.gitee.io/blog/posts/8beb8acd.html"><meta property="og:site_name" content="Gjboy"><meta property="og:description" content="分享一个ABAP程序编写标准模板，让你的程序变得更加规范，更加具有可读性。"><meta property="og:locale" content="zh_CN"><meta property="og:image" content="https://gitee.com/zyhcs/image/raw/master/20210304160604.jpg"><meta property="article:published_time" content="2021-03-02T22:50:00.000Z"><meta property="article:modified_time" content="2022-04-13T02:03:34.943Z"><meta property="article:author" content="ZyhCs"><meta property="article:tag" content="ABAP"><meta property="article:tag" content="模板"><meta property="article:tag" content="program"><meta name="twitter:card" content="summary"><meta name="twitter:image" content="https://gitee.com/zyhcs/image/raw/master/20210304160604.jpg"><link rel="shortcut icon" href="/blog/img/favicon.png"><link rel="canonical" href="http://zyhcs.gitee.io/blog/posts/8beb8acd"><link rel="preconnect" href="//cdn.jsdelivr.net"><link rel="preconnect" href="//hm.baidu.com"><link rel="preconnect" href="//s4.cnzz.com"><link rel="preconnect" href="//busuanzi.ibruce.info"><link rel="manifest" href="/blog/img/pwa/manifest.json"><link rel="apple-touch-icon" sizes="180x180" href="/blog/img/pwa/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/blog/img/pwa/32.png"><link rel="icon" type="image/png" sizes="16x16" href="/blog/img/pwa/16.png"><link rel="mask-icon" href="/blog/img/pwa/safari-pinned-tab.svg" color="#5bbad5"><link rel="stylesheet" href="/blog/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload='this.media="all"'><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload='this.media="all"'><script>var _hmt=_hmt||[];!function(){var e=document.createElement("script");e.src="https://hm.baidu.com/hm.js?2dc053e49a4d0ec097db7a88694f605a";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()</script><script async data-pjax="data-pjax" src="https://s4.cnzz.com/z_stat.php?id=1279722549&amp;web_id=1279722549"></script><script>const GLOBAL_CONFIG={root:"/blog/",algolia:void 0,localSearch:{path:"search.xml",languages:{hits_empty:"找不到您查询的内容：${query}"}},translate:{defaultEncoding:2,translateDelay:0,msgToTraditionalChinese:"繁",msgToSimplifiedChinese:"簡"},noticeOutdate:void 0,highlight:{plugin:"highlighjs",highlightCopy:!0,highlightLang:!0},copy:{success:"复制成功",error:"复制错误",noSupport:"浏览器不支持"},relativeDate:{homepage:!1,post:!0},runtime:"天",date_suffix:{just:"刚刚",min:"分钟前",hour:"小时前",day:"天前",month:"个月前"},copyright:void 0,lightbox:"mediumZoom",Snackbar:{chs_to_cht:"你已切换为繁体",cht_to_chs:"你已切换为简体",day_to_night:"你已切换为深色模式",night_to_day:"你已切换为浅色模式",bgLight:"#49b1f5",bgDark:"#121212",position:"bottom-left"},source:{jQuery:"https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js",justifiedGallery:{js:"https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js",css:"https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css"},fancybox:{js:"https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js",css:"https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css"}},isPhotoFigcaption:!0,islazyload:!0,isanchor:!1}</script><script id="config-diff">var GLOBAL_CONFIG_SITE={isPost:!0,isHome:!1,isHighlightShrink:!1,isToc:!0,postUpdate:"2022-04-13 10:03:34"}</script><noscript><style>#nav{opacity:1}.justified-gallery img{opacity:1}#post-meta time,#recent-posts time{display:inline!important}</style></noscript><script>(e=>{e.saveToLocal={set:function(e,t,o){if(0===o)return;const a=864e5*o,n={value:t,expiry:(new Date).getTime()+a};localStorage.setItem(e,JSON.stringify(n))},get:function(e){const t=localStorage.getItem(e);if(!t)return;const o=JSON.parse(t);if(!((new Date).getTime()>o.expiry))return o.value;localStorage.removeItem(e)}},e.getScript=e=>new Promise((t,o)=>{const a=document.createElement("script");a.src=e,a.async=!0,a.onerror=o,a.onload=a.onreadystatechange=function(){const e=this.readyState;e&&"loaded"!==e&&"complete"!==e||(a.onload=a.onreadystatechange=null,t())},document.head.appendChild(a)}),e.activateDarkMode=function(){document.documentElement.setAttribute("data-theme","dark"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#0d0d0d")},e.activateLightMode=function(){document.documentElement.setAttribute("data-theme","light"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#ffffff")};const t=saveToLocal.get("theme"),o=(new Date).getHours();void 0===t?o<=6||o>=18?activateDarkMode():activateLightMode():"light"===t?activateLightMode():activateDarkMode();const a=saveToLocal.get("aside-status");void 0!==a&&("hide"===a?document.documentElement.classList.add("hide-aside"):document.documentElement.classList.remove("hide-aside"))})(window)</script><meta name=" -site-verification" content="brIBW7JhHugYUFjAnO-t1-UZWYnopQuMfM8LbBKcUPo"><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/l-lin/font-awesome-animation/dist/font-awesome-animation.min.css" media="defer" onload='this.media="all"'><link rel="preconnect" href="https://fonts.gstatic.com"><link href="https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&display=swap" rel="stylesheet"><style>.app-refresh{position:fixed;top:-2.2rem;left:0;right:0;z-index:99999;padding:0 1rem;font-size:15px;height:2.2rem;transition:all .3s ease}.app-refresh-wrap{display:flex;color:#fff;height:100%;align-items:center;justify-content:center}.app-refresh-wrap a{color:#fff;text-decoration:underline;cursor:pointer}</style><meta name="generator" content="Hexo 5.4.0"><style>.github-emoji{position:relative;display:inline-block;width:1.2em;min-height:1.2em;overflow:hidden;vertical-align:top;color:transparent}.github-emoji>span{position:relative;z-index:10}.github-emoji .fancybox,.github-emoji img{margin:0!important;padding:0!important;border:none!important;outline:0!important;text-decoration:none!important;user-select:none!important;cursor:auto!important}.github-emoji img{height:1.2em!important;width:1.2em!important;position:absolute!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;user-select:none!important;cursor:auto!important}.github-emoji-fallback{color:inherit}.github-emoji-fallback img{opacity:0!important}</style><link rel="alternate" href="/blog/atom.xml" title="Gjboy" type="application/atom+xml"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="author-avatar"><img class="avatar-img" data-lazy-src="https://gitee.com/zyhcs/image/raw/master/avatar.jpg" onerror='onerror=null,src="/img/friend_404.gif"' alt="avatar"></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/blog/archives/"><div class="headline">文章</div><div class="length-num">9</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/blog/tags/"><div class="headline">标签</div><div class="length-num">23</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/blog/categories/"><div class="headline">分类</div><div class="length-num">7</div></a></div></div></div><hr><div class="menus_items"><div class="menus_item"><a class="site-page" href="/blog/"><i class="fa-fw fas fa-home"></i> <span>首页</span></a></div><div class="menus_item"><a class="site-page" href="/blog/archives/"><i class="fa-fw fas fa-archive"></i> <span>归档</span></a></div><div class="menus_item"><a class="site-page" href="/blog/tags/"><i class="fa-fw fas fa-tags"></i> <span>标签</span></a></div><div class="menus_item"><a class="site-page" href="/blog/categories/"><i class="fa-fw fas fa-folder-open"></i> <span>分类</span></a></div><div class="menus_item"><a class="site-page" href="/blog/tools/"><i class="fa-fw fas fa-tools"></i> <span>工具</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i> <span>追系列</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/blog/book/"><i class="fa-fw fas fa-book"></i> <span>阅读</span></a></li><li><a class="site-page" href="/blog/bangumis/"><i class="fa-fw fas fa-tools"></i> <span>番剧</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/blog/blogroll/"><i class="fa-fw fas fa-tools"></i> <span>Blog订阅</span></a></div><div class="menus_item"><a class="site-page" href="/blog/link/"><i class="fa-fw fas fa-link"></i> <span>友链</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-heart"></i> <span>其他</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/blog/about/"><i class="fa-fw fas fa-heart"></i> <span>关于我</span></a></li><li><a class="site-page" href="/blog/guestbook/"><i class="fa-fw fas fa-book"></i> <span>留言板</span></a></li></ul></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image:url(https://gitee.com/zyhcs/image/raw/master/20210304160604.jpg)"><nav id="nav"><span id="blog_name"><a id="site-name" href="/blog/">Gjboy</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i> <span>搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/blog/"><i class="fa-fw fas fa-home"></i> <span>首页</span></a></div><div class="menus_item"><a class="site-page" href="/blog/archives/"><i class="fa-fw fas fa-archive"></i> <span>归档</span></a></div><div class="menus_item"><a class="site-page" href="/blog/tags/"><i class="fa-fw fas fa-tags"></i> <span>标签</span></a></div><div class="menus_item"><a class="site-page" href="/blog/categories/"><i class="fa-fw fas fa-folder-open"></i> <span>分类</span></a></div><div class="menus_item"><a class="site-page" href="/blog/tools/"><i class="fa-fw fas fa-tools"></i> <span>工具</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i> <span>追系列</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/blog/book/"><i class="fa-fw fas fa-book"></i> <span>阅读</span></a></li><li><a class="site-page" href="/blog/bangumis/"><i class="fa-fw fas fa-tools"></i> <span>番剧</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/blog/blogroll/"><i class="fa-fw fas fa-tools"></i> <span>Blog订阅</span></a></div><div class="menus_item"><a class="site-page" href="/blog/link/"><i class="fa-fw fas fa-link"></i> <span>友链</span></a></div><div class="menus_item"><a class="site-page" href="javascript:void(0);"><i class="fa-fw fas fa-heart"></i> <span>其他</span><i class="fas fa-chevron-down expand"></i></a><ul class="menus_item_child"><li><a class="site-page" href="/blog/about/"><i class="fa-fw fas fa-heart"></i> <span>关于我</span></a></li><li><a class="site-page" href="/blog/guestbook/"><i class="fa-fw fas fa-book"></i> <span>留言板</span></a></li></ul></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">记录ABAP开发的日常——标准程序模板</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2021-03-02T22:50:00.000Z" title="发表于 2021-03-03 06:50:00">2021-03-03</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-04-13T02:03:34.943Z" title="更新于 2022-04-13 10:03:34">2022-04-13</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/blog/categories/ABAP/">ABAP</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">2.1k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>9分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="记录ABAP开发的日常——标准程序模板"><a href="#记录ABAP开发的日常——标准程序模板" class="headerlink" title="记录ABAP开发的日常——标准程序模板"></a>记录ABAP开发的日常——标准程序模板</h2><h2 id="前言："><a href="#前言：" class="headerlink" title="前言："></a>前言：</h2><blockquote><p>在SAP开发中，写程序是我们必不可少的流程，但由于ABAP程序是一个<strong>事件驱动型</strong>程序，所以在编写代码时，代码的顺序可能就会跟编程者的书写风格有关，不同的开发者具有不同的开发风格，导致编写的ABAP程序风格迥异，没有一个统一的标准，不便于解读。为了解决这一问题，开发者们开始推荐使用<strong>ABAP程序编写规范</strong>，在此便诞生了众多的ABAP程序编写标准模板，今天小度°也给大家带来了一份ABAP模板:</p></blockquote><h3 id="ABAP程序编写标准模板："><a href="#ABAP程序编写标准模板：" class="headerlink" title="ABAP程序编写标准模板："></a>ABAP程序编写标准模板：</h3><figure class="highlight plain"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br><span class="line">360</span><br><span class="line">361</span><br><span class="line">362</span><br><span class="line">363</span><br><span class="line">364</span><br><span class="line">365</span><br><span class="line">366</span><br><span class="line">367</span><br><span class="line">368</span><br><span class="line">369</span><br><span class="line">370</span><br><span class="line">371</span><br><span class="line">372</span><br><span class="line">373</span><br><span class="line">374</span><br><span class="line">375</span><br><span class="line">376</span><br><span class="line">377</span><br><span class="line">378</span><br><span class="line">379</span><br><span class="line">380</span><br><span class="line">381</span><br><span class="line">382</span><br><span class="line">383</span><br><span class="line">384</span><br><span class="line">385</span><br><span class="line">386</span><br><span class="line">387</span><br><span class="line">388</span><br><span class="line">389</span><br><span class="line">390</span><br><span class="line">391</span><br><span class="line">392</span><br><span class="line">393</span><br><span class="line">394</span><br><span class="line">395</span><br><span class="line">396</span><br><span class="line">397</span><br><span class="line">398</span><br><span class="line">399</span><br><span class="line">400</span><br><span class="line">401</span><br><span class="line">402</span><br><span class="line">403</span><br><span class="line">404</span><br><span class="line">405</span><br><span class="line">406</span><br><span class="line">407</span><br><span class="line">408</span><br><span class="line">409</span><br><span class="line">410</span><br><span class="line">411</span><br><span class="line">412</span><br><span class="line">413</span><br><span class="line">414</span><br><span class="line">415</span><br><span class="line">416</span><br><span class="line">417</span><br><span class="line">418</span><br><span class="line">419</span><br><span class="line">420</span><br><span class="line">421</span><br><span class="line">422</span><br><span class="line">423</span><br><span class="line">424</span><br><span class="line">425</span><br><span class="line">426</span><br><span class="line">427</span><br><span class="line">428</span><br><span class="line">429</span><br><span class="line">430</span><br><span class="line">431</span><br><span class="line">432</span><br><span class="line">433</span><br><span class="line">434</span><br><span class="line">435</span><br><span class="line">436</span><br><span class="line">437</span><br><span class="line">438</span><br><span class="line">439</span><br><span class="line">440</span><br><span class="line">441</span><br><span class="line">442</span><br><span class="line">443</span><br><span class="line">444</span><br><span class="line">445</span><br><span class="line">446</span><br><span class="line">447</span><br><span class="line">448</span><br><span class="line">449</span><br><span class="line">450</span><br><span class="line">451</span><br><span class="line">452</span><br><span class="line">453</span><br><span class="line">454</span><br><span class="line">455</span><br><span class="line">456</span><br><span class="line">457</span><br><span class="line">458</span><br><span class="line">459</span><br><span class="line">460</span><br><span class="line">461</span><br><span class="line">462</span><br><span class="line">463</span><br><span class="line">464</span><br><span class="line">465</span><br><span class="line">466</span><br><span class="line">467</span><br><span class="line">468</span><br><span class="line">469</span><br><span class="line">470</span><br><span class="line">471</span><br><span class="line">472</span><br><span class="line">473</span><br><span class="line">474</span><br><span class="line">475</span><br><span class="line">476</span><br><span class="line">477</span><br><span class="line">478</span><br><span class="line">479</span><br><span class="line">480</span><br><span class="line">481</span><br><span class="line">482</span><br><span class="line">483</span><br><span class="line">484</span><br><span class="line">485</span><br><span class="line">486</span><br><span class="line">487</span><br><span class="line">488</span><br><span class="line">489</span><br><span class="line">490</span><br><span class="line">491</span><br><span class="line">492</span><br><span class="line">493</span><br><span class="line">494</span><br><span class="line">495</span><br><span class="line">496</span><br><span class="line">497</span><br><span class="line">498</span><br><span class="line">499</span><br><span class="line">500</span><br><span class="line">501</span><br><span class="line">502</span><br><span class="line">503</span><br><span class="line">504</span><br><span class="line">505</span><br><span class="line">506</span><br><span class="line">507</span><br><span class="line">508</span><br><span class="line">509</span><br><span class="line">510</span><br><span class="line">511</span><br><span class="line">512</span><br><span class="line">513</span><br><span class="line">514</span><br><span class="line">515</span><br><span class="line">516</span><br><span class="line">517</span><br><span class="line">518</span><br><span class="line">519</span><br><span class="line">520</span><br><span class="line">521</span><br><span class="line">522</span><br><span class="line">523</span><br><span class="line">524</span><br><span class="line">525</span><br><span class="line">526</span><br><span class="line">527</span><br><span class="line">528</span><br><span class="line">529</span><br><span class="line">530</span><br><span class="line">531</span><br><span class="line">532</span><br><span class="line">533</span><br><span class="line">534</span><br><span class="line">535</span><br><span class="line">536</span><br><span class="line">537</span><br><span class="line">538</span><br><span class="line">539</span><br><span class="line">540</span><br><span class="line">541</span><br><span class="line">542</span><br><span class="line">543</span><br><span class="line">544</span><br><span class="line">545</span><br><span class="line">546</span><br><span class="line">547</span><br><span class="line">548</span><br><span class="line">549</span><br><span class="line">550</span><br><span class="line">551</span><br><span class="line">552</span><br><span class="line">553</span><br><span class="line">554</span><br><span class="line">555</span><br><span class="line">556</span><br><span class="line">557</span><br><span class="line">558</span><br><span class="line">559</span><br><span class="line">560</span><br><span class="line">561</span><br><span class="line">562</span><br><span class="line">563</span><br><span class="line">564</span><br><span class="line">565</span><br><span class="line">566</span><br><span class="line">567</span><br><span class="line">568</span><br><span class="line">569</span><br><span class="line">570</span><br><span class="line">571</span><br><span class="line">572</span><br><span class="line">573</span><br><span class="line">574</span><br><span class="line">575</span><br><span class="line">576</span><br><span class="line">577</span><br><span class="line">578</span><br><span class="line">579</span><br><span class="line">580</span><br><span class="line">581</span><br><span class="line">582</span><br><span class="line">583</span><br><span class="line">584</span><br><span class="line">585</span><br><span class="line">586</span><br><span class="line">587</span><br><span class="line">588</span><br><span class="line">589</span><br><span class="line">590</span><br><span class="line">591</span><br><span class="line">592</span><br><span class="line">593</span><br><span class="line">594</span><br><span class="line">595</span><br><span class="line">596</span><br><span class="line">597</span><br><span class="line">598</span><br><span class="line">599</span><br><span class="line">600</span><br><span class="line">601</span><br><span class="line">602</span><br><span class="line">603</span><br><span class="line">604</span><br><span class="line">605</span><br><span class="line">606</span><br><span class="line">607</span><br><span class="line">608</span><br><span class="line">609</span><br><span class="line">610</span><br><span class="line">611</span><br><span class="line">612</span><br><span class="line">613</span><br><span class="line">614</span><br><span class="line">615</span><br><span class="line">616</span><br><span class="line">617</span><br><span class="line">618</span><br><span class="line">619</span><br><span class="line">620</span><br><span class="line">621</span><br><span class="line">622</span><br><span class="line">623</span><br><span class="line">624</span><br><span class="line">625</span><br><span class="line">626</span><br><span class="line">627</span><br><span class="line">628</span><br><span class="line">629</span><br><span class="line">630</span><br><span class="line">631</span><br><span class="line">632</span><br><span class="line">633</span><br><span class="line">634</span><br><span class="line">635</span><br><span class="line">636</span><br><span class="line">637</span><br><span class="line">638</span><br><span class="line">639</span><br><span class="line">640</span><br><span class="line">641</span><br><span class="line">642</span><br><span class="line">643</span><br><span class="line">644</span><br><span class="line">645</span><br><span class="line">646</span><br><span class="line">647</span><br><span class="line">648</span><br><span class="line">649</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">**&amp;--------------------------「程序说明-START」-------------------------*</span><br><span class="line">*</span><br><span class="line">**&amp; Report  Z_X_XXXXX01</span><br><span class="line">*</span><br><span class="line">**&amp; Module                   :  Module \ SubModule</span><br><span class="line">*</span><br><span class="line">**&amp; Created                  :  ZHANGYH  (2020.12.21)</span><br><span class="line">*</span><br><span class="line">**&amp; Modified                 :  ZHANGYH  (2020.12.21)</span><br><span class="line">*</span><br><span class="line">**&amp; Intention                :  程序标题</span><br><span class="line">*</span><br><span class="line">**  Detail(详细说明):</span><br><span class="line">*</span><br><span class="line">**</span><br><span class="line">*</span><br><span class="line">**&amp;--------------------------「程序说明-END」--------------------------*</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;--------------------------「程序引入」------------------------------*</span><br><span class="line">*</span><br><span class="line">**INCLUDE Z_X_TOP .           " TOP 子程序，用来声明全局变量</span><br><span class="line">*</span><br><span class="line">**--------以下三个子程序只有在多个程序调用同一逻辑时才建议使用---------*</span><br><span class="line">*</span><br><span class="line">**INCLUDE Z_X_O01 .                          " PBO 子程序</span><br><span class="line">*</span><br><span class="line">**INCLUDE Z_X_I01 .                          " PAI 子程序</span><br><span class="line">*</span><br><span class="line">**INCLUDE Z_X_F01 .                          " FORM 子程序</span><br><span class="line">*</span><br><span class="line">**&amp;--------------------------「类型声明」------------------------------*</span><br><span class="line">**TABLES:ITAB1,ITAN2...</span><br><span class="line">*</span><br><span class="line">** 定义ALV输出结构</span><br><span class="line">*TYPES:BEGIN OF OUTPUT,</span><br><span class="line">*</span><br><span class="line">*END OF OUTPUT.</span><br><span class="line">*</span><br><span class="line">** 定义输出内表</span><br><span class="line">*DATA: GT_OUTPUT TYPE TABLE OF OUTPUT,</span><br><span class="line">*      GS_OUTPUT TYPE OUTPUT.</span><br><span class="line">*</span><br><span class="line">** 定义ALV数据选择内表</span><br><span class="line">**DATA: GT_CHECKED TYPE TABLE OF OUTPUT,</span><br><span class="line">**      GS_CHECKED TYPE OUTPUT.</span><br><span class="line">*</span><br><span class="line">** 定义SmartForms抬头内表</span><br><span class="line">**DATA: GT_HEAD TYPE TABLE OF OUTPUT,</span><br><span class="line">**      GS_HEAD TYPE OUTPUT.</span><br><span class="line">*</span><br><span class="line">** 定义SmartForms行项目内表</span><br><span class="line">**DATA: GT_DATA TYPE TABLE OF OUTPUT,</span><br><span class="line">**      GS_DATA TYPE OUTPUT.</span><br><span class="line">*</span><br><span class="line">*FIELD-SYMBOLS:&lt;FS_OPT&gt; TYPE OUTPUT.</span><br><span class="line">*</span><br><span class="line">** 定义AVL变量</span><br><span class="line">**DATA: GT_FIELDCAT TYPE LVC_T_FCAT,</span><br><span class="line">**      GS_FIELDCAT TYPE LVC_S_FCAT,</span><br><span class="line">**      GS_DECIMALS TYPE LVC_DECMLS,</span><br><span class="line">**      GS_LAYOUT   TYPE LVC_S_LAYO.</span><br><span class="line">*</span><br><span class="line">** 定义SMART FORMS变量</span><br><span class="line">**DATA: SSF_NAME         TYPE TDSFNAME,</span><br><span class="line">**      L_FM_NAME        TYPE RS38L_FNAM,</span><br><span class="line">**      CONTROL          TYPE SSFCTRLOP,</span><br><span class="line">**      OUTPUT_OPTIONS   TYPE SSFCOMPOP,</span><br><span class="line">**      JOB_OUTPUT_INFO  TYPE SSFCRESCL.</span><br><span class="line">*</span><br><span class="line">**&amp;------------------------「选择屏幕声明」----------------------------*</span><br><span class="line">*</span><br><span class="line">*SELECTION-SCREEN:BEGIN OF BLOCK BK1 WITH FRAME TITLE TEXT-001   .</span><br><span class="line">** 区间</span><br><span class="line">*  SELECT-OPTIONS:</span><br><span class="line">*    S_FIELD FOR ITAB-FIELD NO INTERVALS NO-EXTENSION .</span><br><span class="line">*  SELECTION-SCREEN ULINE.</span><br><span class="line">** 单值</span><br><span class="line">*  PARAMETERS:P_FIELD AS CHECKBOX,            "复选框"</span><br><span class="line">*             P_RTN1 RADIOBUTTON GROUP G1,    "单选按钮一"</span><br><span class="line">*             P_RTN2 RADIOBUTTON GROUP G1.    "单选按钮二"</span><br><span class="line">*SELECTION-SCREEN END OF BLOCK BK1.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;------------------------「程序主进程」------------------------------*</span><br><span class="line">*</span><br><span class="line">*INITIALIZATION.</span><br><span class="line">*</span><br><span class="line">**  PERFORM  INI_SELECTION_SCREEN.           " 初始化选择屏上的变量</span><br><span class="line">*</span><br><span class="line">*AT SELECTION-SCREEN OUTPUT.</span><br><span class="line">*</span><br><span class="line">**  PERFORM  FRM_INI_SCREEN.                 " 初始化选择屏幕</span><br><span class="line">*</span><br><span class="line">*AT SELECTION-SCREEN .</span><br><span class="line">*</span><br><span class="line">**  PERFORM  FRM_INI_DATA.                   " 初始化全局变量</span><br><span class="line">*</span><br><span class="line">*START-OF-SELECTION.</span><br><span class="line">*</span><br><span class="line">*  PERFORM  FRM_PRECESS_DATA.                " 主要数据处理逻辑</span><br><span class="line">*</span><br><span class="line">*END-OF-SELECTION.</span><br><span class="line">*</span><br><span class="line">**  PERFORM FRM_DISPLAY_DATA.                " 数据展示输出</span><br><span class="line">*</span><br><span class="line">*AT LINE-SELECTION.</span><br><span class="line">*</span><br><span class="line">**  PERFORM  FRM_PRECESS_LINE_SELECTED.      " 行选择时的处理</span><br><span class="line">*</span><br><span class="line">*AT USER-COMMAND.</span><br><span class="line">*</span><br><span class="line">**  PERFORM  FRM_PRECESS_USER_COMMAND.       " 用自定义命令按钮时的处理</span><br><span class="line">*</span><br><span class="line">*TOP-OF-PAGE.</span><br><span class="line">*</span><br><span class="line">**  PERFORM  FRM_PAGE_HEADER.                " 页眉</span><br><span class="line">*</span><br><span class="line">*END-OF-PAGE.</span><br><span class="line">*</span><br><span class="line">**  PERFORM  FRM_PAGE_FOOTER.                " 页脚</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form INI_SELECTION_SCREEN</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 初始化选择屏上的变量</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM INI_SELECTION_SCREEN .</span><br><span class="line">*</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form INI_DATA</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 初始化全局变量</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_INI_DATA .</span><br><span class="line">*</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_PRECESS_DATA</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 主要数据处理逻辑</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_PRECESS_DATA .</span><br><span class="line">*  PERFORM  SEL_DATA_TO_ITAB.       " 从透明表中取数据赋给内表</span><br><span class="line">*</span><br><span class="line">*  PERFORM  CHECK_DATA_FROM_ITAB.   " 内表数据进行效验</span><br><span class="line">*</span><br><span class="line">*  PERFORM  CMP_DATA_FROM_ITAB.     " 内表中数据计算处理</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_DISPLAY_DATA</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 数据展示输出</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_DISPLAY_DATA .</span><br><span class="line">*  PERFORM FRM_SET_LAYOUT.          " 设置ALV布局</span><br><span class="line">*</span><br><span class="line">*  PERFORM FRM_SET_FIELDCAT.        " 设置ALV展示字段</span><br><span class="line">*</span><br><span class="line">*  PERFORM FRM_DISPLAY_ALV.         " 设置ALV数据展示</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_PRECESS_LINE_SELECTED</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 行选择时的处理</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_PRECESS_LINE_SELECTED .</span><br><span class="line">*</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_PRECESS_USER_COMMAND</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 用自定义命令按钮时的处理</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_PRECESS_USER_COMMAND .</span><br><span class="line">*</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_PAGE_HEADER</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 页眉</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_PAGE_HEADER .</span><br><span class="line">*</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_PAGE_FOOTER</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 页脚</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_PAGE_FOOTER .</span><br><span class="line">*</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form SEL_DATA_TO_ITAB</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 从透明表中取数据赋给内表</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM SEL_DATA_TO_ITAB .</span><br><span class="line">**&amp;--------------------------「取主线数据」-----------------------------*</span><br><span class="line">*  SELECT *</span><br><span class="line">*  INTO CORRESPONDING FIELDS OF TABLE GT_OUTPUT</span><br><span class="line">*  FROM ITAB1 AS A INNER JOIN ITAB2 AS B ON A~FIELD = B~FIELD UP TO 100 ROWS.</span><br><span class="line">*</span><br><span class="line">**&amp;--------------------------「取支线数据」-----------------------------*</span><br><span class="line">*  IF GT_OUTPUT IS NOT INITIAL.</span><br><span class="line">**    SELECT...</span><br><span class="line">*</span><br><span class="line">**    LOOP AT GT_OUTPUT ASSIGNING &lt;FS_OPT&gt;.</span><br><span class="line">**    ENDLOOP.</span><br><span class="line">*  ENDIF.</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form CHECK_DATA_FROM_ITAB</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 内表数据进行效验</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM CHECK_DATA_FROM_ITAB .</span><br><span class="line">*</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form CMP_DATA_FROM_ITAB</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 内表中数据计算处理</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM CMP_DATA_FROM_ITAB .</span><br><span class="line">*</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_INI_SCREEN</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 初始化选择屏幕</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_INI_SCREEN .</span><br><span class="line">*</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_SET_LAYOUT</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 设置ALV布局</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_SET_LAYOUT .</span><br><span class="line">*  GS_LAYOUT-ZEBRA      = 'X'.</span><br><span class="line">*  GS_LAYOUT-SEL_MODE   = 'X'.</span><br><span class="line">*  GS_LAYOUT-CWIDTH_OPT = 'X'.</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_SET_FIELDCAT</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 设置ALV展示字段</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_SET_FIELDCAT .</span><br><span class="line">*  CLEAR GT_FIELDCAT.</span><br><span class="line">**   调用生产ALV展示字段</span><br><span class="line">*    PERFORM FRM_SET_FIELDS USING: 'CHECKBOX'        '请选择'   ''   ''   'X'  'X',</span><br><span class="line">*                                  'ZNUM'            '序号'     ''   ''   ''   '' .</span><br><span class="line">*    ENDFORM.</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_SET_FIELDS</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 定义字段自动生成</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_SET_FIELDS  USING PV_FIELDNAME PV_REPTEXT PV_ZERO PV_OUT PV_CHECKBOX PV_EDIT.</span><br><span class="line">*  INSERT VALUE #(</span><br><span class="line">*  FIELDNAME = PV_FIELDNAME</span><br><span class="line">*  REPTEXT = PV_REPTEXT</span><br><span class="line">*  NO_ZERO = PV_ZERO</span><br><span class="line">*  NO_OUT = PV_OUT</span><br><span class="line">*  CHECKBOX = PV_CHECKBOX</span><br><span class="line">*  EDIT = PV_EDIT</span><br><span class="line">*  )</span><br><span class="line">*  INTO TABLE GT_FIELDCAT.</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_DISPLAY_ALV</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 定义ALV输出函数</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_DISPLAY_ALV .</span><br><span class="line">*</span><br><span class="line">*  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'</span><br><span class="line">*    EXPORTING</span><br><span class="line">**     I_INTERFACE_CHECK                 = ' '</span><br><span class="line">**     I_BYPASSING_BUFFER                =</span><br><span class="line">**     I_BUFFER_ACTIVE                   =</span><br><span class="line">*      I_CALLBACK_PROGRAM                = SY-REPID</span><br><span class="line">*      I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'</span><br><span class="line">*      I_CALLBACK_USER_COMMAND           = 'ALV_USER_COMMAND'</span><br><span class="line">**     I_CALLBACK_TOP_OF_PAGE            = ' '</span><br><span class="line">**     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '</span><br><span class="line">**     I_CALLBACK_HTML_END_OF_LIST       = ' '</span><br><span class="line">**     I_STRUCTURE_NAME                  =</span><br><span class="line">**     I_BACKGROUND_ID                   = ' '</span><br><span class="line">**     I_GRID_TITLE                      =</span><br><span class="line">**     I_GRID_SETTINGS                   =</span><br><span class="line">*      IS_LAYOUT_LVC                     = GS_LAYOUT</span><br><span class="line">*      IT_FIELDCAT_LVC                   = GT_FIELDCAT</span><br><span class="line">**     IT_EXCLUDING                      =</span><br><span class="line">**     IT_SPECIAL_GROUPS_LVC             =</span><br><span class="line">**     IT_SORT_LVC                       =</span><br><span class="line">**     IT_FILTER_LVC                     =</span><br><span class="line">**     IT_HYPERLINK                      =</span><br><span class="line">**     IS_SEL_HIDE                       =</span><br><span class="line">**     I_DEFAULT                         = 'X'</span><br><span class="line">*      I_SAVE                            = 'A'</span><br><span class="line">**     IS_VARIANT                        =</span><br><span class="line">**     IT_EVENTS                         =</span><br><span class="line">**     IT_EVENT_EXIT                     =</span><br><span class="line">**     IS_PRINT_LVC                      =</span><br><span class="line">**     IS_REPREP_ID_LVC                  =</span><br><span class="line">**     I_SCREEN_START_COLUMN             = 0</span><br><span class="line">**     I_SCREEN_START_LINE               = 0</span><br><span class="line">**     I_SCREEN_END_COLUMN               = 0</span><br><span class="line">**     I_SCREEN_END_LINE                 = 0</span><br><span class="line">**     I_HTML_HEIGHT_TOP                 =</span><br><span class="line">**     I_HTML_HEIGHT_END                 =</span><br><span class="line">**     IT_ALV_GRAPHICS                   =</span><br><span class="line">**     IT_EXCEPT_QINFO_LVC               =</span><br><span class="line">**     IR_SALV_FULLSCREEN_ADAPTER        =</span><br><span class="line">**      IMPORTING</span><br><span class="line">**        E_EXIT_CAUSED_BY_CALLER           =</span><br><span class="line">**        ES_EXIT_CAUSED_BY_USER            =</span><br><span class="line">*    TABLES</span><br><span class="line">*      T_OUTTAB                          = GT_OUTPUT</span><br><span class="line">*    EXCEPTIONS</span><br><span class="line">*      PROGRAM_ERROR                     = 1</span><br><span class="line">*      OTHERS                            = 2.</span><br><span class="line">*    IF SY-SUBRC &lt;&gt; 0.</span><br><span class="line">**   Implement suitable error handling here</span><br><span class="line">*    ENDIF.</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form SET_PF_STATUS</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 定义工具栏按钮状态</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM SET_PF_STATUS USING PT_EXCLUDE TYPE KKBLO_T_EXTAB .</span><br><span class="line">*</span><br><span class="line">** 声明按钮设置内表</span><br><span class="line">**  DATA:LT_EXCLUDE TYPE KKBLO_T_EXTAB WITH HEADER LINE.</span><br><span class="line">**  DATA:LS_EXCLUDE LIKE LINE OF LT_EXCLUDE.</span><br><span class="line">*</span><br><span class="line">**  添加按钮例子:</span><br><span class="line">**  LS_EXCLUDE = '&amp;ADDLINE'.</span><br><span class="line">**  APPEND LS_EXCLUDE TO LT_EXCLUDE[].</span><br><span class="line">**  CLEAR LS_EXCLUDE.</span><br><span class="line">**  LS_EXCLUDE = '&amp;DELLINE'.</span><br><span class="line">**  APPEND LS_EXCLUDE TO LT_EXCLUDE[].</span><br><span class="line">**  CLEAR LS_EXCLUDE.</span><br><span class="line">**  LS_EXCLUDE = '&amp;SAVEMD'.</span><br><span class="line">**  APPEND LS_EXCLUDE TO LT_EXCLUDE[].</span><br><span class="line">**  CLEAR LS_EXCLUDE.</span><br><span class="line">*</span><br><span class="line">**  SET PF-STATUS 'STANDARD' EXCLUDING LT_EXCLUDE[] .</span><br><span class="line">**  如果条件满足:</span><br><span class="line">**  IF P_FILTER IS NOT INITIAL.</span><br><span class="line">**    SET PF-STATUS 'STANDARD' .</span><br><span class="line">**  ENDIF.</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form ALV_USER_COMMAND</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 定义ALV按钮事件</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM ALV_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE SLIS_SELFIELD .</span><br><span class="line">*</span><br><span class="line">** 设置ALV内容改变事件回调</span><br><span class="line">**  DATA: LR_GRID TYPE REF TO CL_GUI_ALV_GRID.</span><br><span class="line">**  DATA: LV_INDEX TYPE I.</span><br><span class="line">**  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'</span><br><span class="line">**  IMPORTING</span><br><span class="line">**    E_GRID = LR_GRID.</span><br><span class="line">**  CALL METHOD LR_GRID-&gt;CHECK_CHANGED_DATA.</span><br><span class="line">** 设置按钮触发事件</span><br><span class="line">**  CASE R_UCOMM.</span><br><span class="line">**  WHEN '&amp;IC1'.                                  " ALV双击事件</span><br><span class="line">**    获取当前双击的行目索引"</span><br><span class="line">**    READ TABLE GT_OUTPUT INDEX RS_SELFIELD-TABINDEX ASSIGNING &lt;FS_OPT&gt;.</span><br><span class="line">**    判断是否是指定的字段？"</span><br><span class="line">**    IF RS_SELFIELD-FIELDNAME EQ 'FIELD1' OR RS_SELFIELD-FIELDNAME EQ 'FIELD2'.</span><br><span class="line">**      PERFORM FRM_ALV_EVENT_IC1.</span><br><span class="line">**    ENDIF.</span><br><span class="line">*</span><br><span class="line">**  WHEN '&amp;PRINT'.</span><br><span class="line">**    PERFORM FRM_ALV_EVENT_PRINT.                " 调用SF打印事件子例程</span><br><span class="line">*</span><br><span class="line">**  WHEN '&amp;BDC'.</span><br><span class="line">**    PERFORM FRM_ALV_EVENT_BDC.                  " 调用BDC批导事件子例程</span><br><span class="line">*</span><br><span class="line">**  WHEN '&amp;BAPI'.</span><br><span class="line">**    PERFORM FRM_ALV_EVENT_BAPI.                 " 调用BAPI批导事件子例程</span><br><span class="line">*</span><br><span class="line">**  WHEN '&amp;FC01'.</span><br><span class="line">**    PERFORM FRM_ALV_EVENT_FC01.                 " 调用FC01按钮事件子例程</span><br><span class="line">*</span><br><span class="line">**  WHEN '&amp;FC02'.</span><br><span class="line">**    PERFORM FRM_ALV_EVENT_FC02.                 " 调用FC02按钮事件子例程</span><br><span class="line">**  WHEN OTHERS.</span><br><span class="line">**  ENDCASE.</span><br><span class="line">**  RS_SELFIELD-REFRESH = 'X'.                    " 刷新ALV屏幕</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_ALV_EVENT_IC1</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 定义ALV双击事件子例程</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_ALV_EVENT_IC1 .</span><br><span class="line">*</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_ALV_EVENT_PRINT</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 定义SF打印事件子例程</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_ALV_EVENT_PRINT .</span><br><span class="line">*  PERFORM FRM_DEAL_DATA.                        " 数据预处理</span><br><span class="line">*  PERFORM FRM_DATA_PRINT.                       " SmartForms数据打印</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_ALV_EVENT_BDC</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 定义BDC批导事件子例程</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_ALV_EVENT_BDC .</span><br><span class="line">*</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_ALV_EVENT_BAPI</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 定义BAPI批导事件子例程</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_ALV_EVENT_BAPI .</span><br><span class="line">*</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_ALV_EVENT_FC01</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 定义FC01按钮事件子例程</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_ALV_EVENT_FC01 .</span><br><span class="line">*</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_ALV_EVENT_FC02</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 定义FC02按钮事件子例程</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_ALV_EVENT_FC02 .</span><br><span class="line">*</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_DEAL_DATA</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; SF打印数据预处理</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_DEAL_DATA .</span><br><span class="line">**  清空勾选内表数据</span><br><span class="line">**  CLEAR GT_CHECKED.</span><br><span class="line">**  将勾选的数据放到临时内表中</span><br><span class="line">**   LOOP AT GT_OUTPUT ASSIGNING &lt;FS_OPT&gt; WHERE CHECKBOX = 'X' .</span><br><span class="line">**   如果被勾选，则将数据添加到勾选内表中"</span><br><span class="line">**    MOVE-CORRESPONDING &lt;FS_OPT&gt; TO GS_CHECKED.</span><br><span class="line">**    APPEND GS_CHECKED TO GT_CHECKED.</span><br><span class="line">**   如果返回状态值为0</span><br><span class="line">**    IF SY-SUBRC = 0.</span><br><span class="line">**     提交事务</span><br><span class="line">**      COMMIT WORK.</span><br><span class="line">**     如果返回状态不为0</span><br><span class="line">**    ELSE.</span><br><span class="line">**     回滚事务</span><br><span class="line">**      ROLLBACK WORK.</span><br><span class="line">**    ENDIF.</span><br><span class="line">**   清空结构</span><br><span class="line">**    CLEAR GS_CHECKED.</span><br><span class="line">**   ENDLOOP.</span><br><span class="line">** 当有勾选的数据时才调用打印</span><br><span class="line">**  IF GT_CHECKED IS NOT INITIAL.</span><br><span class="line">**   遍历勾选内表 获取打印抬头数据</span><br><span class="line">**    CLEAR GT_HEAD.</span><br><span class="line">**    LOOP AT GT_CHECKED INTO GS_CHECKED .</span><br><span class="line">**     根据条件获取抬头</span><br><span class="line">**      READ TABLE GT_HEAD WITH KEY FIELD = GS_CHECKED-FIELD INTO GS_HEAD.</span><br><span class="line">**     抬头表为空,肯定获取不到数据,所以状态不为0</span><br><span class="line">**      IF SY-SUBRC &lt;&gt; 0.</span><br><span class="line">**       将需要的数据加入到抬头内表</span><br><span class="line">**        MOVE-CORRESPONDING GS_CHECKED TO GS_HEAD.</span><br><span class="line">**        APPEND GS_HEAD TO GT_HEAD.</span><br><span class="line">**      ENDIF.</span><br><span class="line">**      清空勾选结构</span><br><span class="line">**      CLEAR GS_CHECKED.</span><br><span class="line">**    ENDLOOP.</span><br><span class="line">**  ELSE.</span><br><span class="line">**   没有勾选数据</span><br><span class="line">**    MESSAGE '请勾选数据！' TYPE 'E' .</span><br><span class="line">**  ENDIF.</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_DATA_PRINT</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; SmartForms数据打印</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_DATA_PRINT .</span><br><span class="line">** 定义smartforms参数，实现假脱机</span><br><span class="line">**  CONTROL-PREVIEW           =  ''  .</span><br><span class="line">**  CONTROL-NO_DIALOG         =  ''  .</span><br><span class="line">**  CONTROL-NO_OPEN           =  'X' .</span><br><span class="line">**  CONTROL-NO_CLOSE          =  'X' .</span><br><span class="line">**  OUTPUT_OPTIONS-TDIMMED    =  'X' .</span><br><span class="line">**  OUTPUT_OPTIONS-TDARMOD    =   1  .</span><br><span class="line">**  GS_OUTPUT_OPTIONS-TDIEXIT =  'X' .</span><br><span class="line">*</span><br><span class="line">** 开启假脱机"</span><br><span class="line">**  PERFORM FRM_OPEN_SSF.</span><br><span class="line">** 开启循环打印</span><br><span class="line">** 遍历抬头表 根据指定条件从勾选内表中获取行项目数据</span><br><span class="line">**  LOOP AT GT_HEAD INTO GS_HEAD .</span><br><span class="line">**   清空行项目表</span><br><span class="line">**    CLEAR GT_DATA.</span><br><span class="line">**   遍历勾选内表,根据抬头表的条件</span><br><span class="line">**    LOOP AT GT_CHECKED INTO GS_CHECKED WHERE FIELD = GS_HEAD-FIELD.</span><br><span class="line">**     将需要的行项目数据放入数据表内</span><br><span class="line">**      MOVE-CORRESPONDING GS_CHECKED TO GS_DATA.</span><br><span class="line">**      APPEND GS_DATA TO GT_DATA.</span><br><span class="line">**     清空勾选结构</span><br><span class="line">**      CLEAR GS_CHECKED.</span><br><span class="line">**    ENDLOOP.</span><br><span class="line">**   调用SmartForms、生成函数接口"</span><br><span class="line">**    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'</span><br><span class="line">**    EXPORTING</span><br><span class="line">**      FORMNAME  = SSF_NAME</span><br><span class="line">**     ARIANT                   = ' '</span><br><span class="line">**     DIRECT_CALL              = ' '</span><br><span class="line">**    IMPORTING</span><br><span class="line">**      FM_NAME   = L_FM_NAME</span><br><span class="line">**    EXCEPTIONS</span><br><span class="line">**      NO_FORM                  = 1</span><br><span class="line">**      NO_FUNCTION_MODULE       = 2</span><br><span class="line">**      OTHERS                   = 3   .</span><br><span class="line">*</span><br><span class="line">**   调用SMARTFORMS生成接口</span><br><span class="line">**    CALL FUNCTION L_FM_NAME</span><br><span class="line">**    EXPORTING</span><br><span class="line">**     传递需要打印的数据</span><br><span class="line">**      TAB_HEAD            =   GS_HEAD</span><br><span class="line">**     设置假脱机参数</span><br><span class="line">**      OUTPUT_OPTIONS      =   OUTPUT_OPTIONS</span><br><span class="line">**      CONTROL_PARAMETERS  =   CONTROL</span><br><span class="line">**    TABLES</span><br><span class="line">**     传入打印数据参数"</span><br><span class="line">**      ITAB1               =   GT_DATA.</span><br><span class="line">*</span><br><span class="line">**    IF SY-SUBRC = 0.</span><br><span class="line">**    ENDIF.</span><br><span class="line">**    CLEAR GS_HEAD.</span><br><span class="line">**  ENDLOOP.</span><br><span class="line">**  打印结束，关闭假脱机"</span><br><span class="line">**  PERFORM FRM_CLOSE_SSF.</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_OPEN_SSF</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 定义假脱机开始参数设置</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_OPEN_SSF .</span><br><span class="line">*  CALL FUNCTION 'SSF_OPEN'</span><br><span class="line">*  EXPORTING</span><br><span class="line">*    USER_SETTINGS      = 'X'</span><br><span class="line">*    CONTROL_PARAMETERS = CONTROL</span><br><span class="line">*    OUTPUT_OPTIONS     = OUTPUT_OPTIONS</span><br><span class="line">*  EXCEPTIONS</span><br><span class="line">*    FORMATTING_ERROR   = 1</span><br><span class="line">*    INTERNAL_ERROR     = 2</span><br><span class="line">*    SEND_ERROR         = 3</span><br><span class="line">*    USER_CANCELED      = 4</span><br><span class="line">*    OTHERS             = 5.</span><br><span class="line">*ENDFORM.</span><br><span class="line">*</span><br><span class="line">*</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; Form FRM_CLOSE_SSF</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">**&amp; 定义假脱机结束参数设置</span><br><span class="line">**&amp;---------------------------------------------------------------------*</span><br><span class="line">*FORM FRM_CLOSE_SSF .</span><br><span class="line">*  CALL FUNCTION 'SSF_CLOSE'</span><br><span class="line">*  IMPORTING</span><br><span class="line">*    JOB_OUTPUT_INFO  = JOB_OUTPUT_INFO</span><br><span class="line">*  EXCEPTIONS</span><br><span class="line">*    FORMATTING_ERROR = 1</span><br><span class="line">*    INTERNAL_ERROR   = 2</span><br><span class="line">*    SEND_ERROR       = 3</span><br><span class="line">*    OTHERS           = 4.</span><br><span class="line">*ENDFORM.</span><br></pre></td></tr></tbody></table></figure></article><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/blog/tags/ABAP/">ABAP</a><a class="post-meta__tags" href="/blog/tags/%E6%A8%A1%E6%9D%BF/">模板</a><a class="post-meta__tags" href="/blog/tags/program/">program</a></div><div class="post_share"><div class="social-share" data-image="https://gitee.com/zyhcs/image/raw/master/20210304160604.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload='this.media="all"'><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button button--animated"><i class="fas fa-qrcode"></i> 打赏</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://gitee.com/zyhcs/image/raw/master/wechat.png" target="_blank"><img class="post-qr-code-img" data-lazy-src="https://gitee.com/zyhcs/image/raw/master/wechat.png" alt="微信"></a><div class="post-qr-code-desc">微信</div></li><li class="reward-item"><a href="https://gitee.com/zyhcs/image/raw/master/alipay.jpg" target="_blank"><img class="post-qr-code-img" data-lazy-src="https://gitee.com/zyhcs/image/raw/master/alipay.jpg" alt="支付宝"></a><div class="post-qr-code-desc">支付宝</div></li></ul></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/blog/posts/b931fe9e.html"><img class="prev-cover" data-lazy-src="https://gitee.com/zyhcs/image/raw/master/20210304160604.jpg" onerror='onerror=null,src="/blog/img/404.jpg"' alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">记录ABAP开发的日常——SAP_PO同步接口开发案例</div></div></a></div><div class="next-post pull-right"><a href="/blog/posts/efbf26c8.html"><img class="next-cover" data-lazy-src="https://gitee.com/zyhcs/image/raw/master/20210304160604.jpg" onerror='onerror=null,src="/blog/img/404.jpg"' alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">记录ABAP开发的日常——功能函数</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i> <span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/blog/posts/b931fe9e.html" title="记录ABAP开发的日常——SAP_PO同步接口开发案例"><img class="cover" data-lazy-src="https://gitee.com/zyhcs/image/raw/master/20210304160604.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="fas fa-history fa-fw"></i> 2022-04-13</div><div class="title">记录ABAP开发的日常——SAP_PO同步接口开发案例</div></div></a></div><div><a href="/blog/posts/efbf26c8.html" title="记录ABAP开发的日常——功能函数"><img class="cover" data-lazy-src="https://gitee.com/zyhcs/image/raw/master/20210304160604.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="fas fa-history fa-fw"></i> 2022-04-13</div><div class="title">记录ABAP开发的日常——功能函数</div></div></a></div><div><a href="/blog/posts/8d3bbb71.html" title="记录ABAP开发的日常——常用日期函数"><img class="cover" data-lazy-src="https://gitee.com/zyhcs/image/raw/master/20210228142122.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="fas fa-history fa-fw"></i> 2022-04-13</div><div class="title">记录ABAP开发的日常——常用日期函数</div></div></a></div></div></div><hr><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i> <span>评论</span></div></div><div class="comment-wrap"><div><div class="vcomment" id="vcomment"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-info-avatar is-center"><img class="avatar-img" data-lazy-src="https://gitee.com/zyhcs/image/raw/master/avatar.jpg" onerror='this.onerror=null,this.src="/blog/img/friend_404.gif"' alt="avatar"><div class="author-info__name">ZyhCs</div><div class="author-info__description">梦想总要有的，万一实现了呢.</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/blog/archives/"><div class="headline">文章</div><div class="length-num">9</div></a></div><div class="card-info-data-item is-center"><a href="/blog/tags/"><div class="headline">标签</div><div class="length-num">23</div></a></div><div class="card-info-data-item is-center"><a href="/blog/categories/"><div class="headline">分类</div><div class="length-num">7</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/zyhcs"><i class="fab fa-heart"></i><span>关 注 我</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/zyhcs" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:zyh.cjs@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">点关注 , 不迷路!</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%AE%B0%E5%BD%95ABAP%E5%BC%80%E5%8F%91%E7%9A%84%E6%97%A5%E5%B8%B8%E2%80%94%E2%80%94%E6%A0%87%E5%87%86%E7%A8%8B%E5%BA%8F%E6%A8%A1%E6%9D%BF"><span class="toc-text">记录ABAP开发的日常——标准程序模板</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%89%8D%E8%A8%80%EF%BC%9A"><span class="toc-text">前言：</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#ABAP%E7%A8%8B%E5%BA%8F%E7%BC%96%E5%86%99%E6%A0%87%E5%87%86%E6%A8%A1%E6%9D%BF%EF%BC%9A"><span class="toc-text">ABAP程序编写标准模板：</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/blog/posts/b931fe9e.html" title="记录ABAP开发的日常——SAP_PO同步接口开发案例"><img data-lazy-src="https://gitee.com/zyhcs/image/raw/master/20210304160604.jpg" onerror='this.onerror=null,this.src="/blog/img/404.jpg"' alt="记录ABAP开发的日常——SAP_PO同步接口开发案例"></a><div class="content"><a class="title" href="/blog/posts/b931fe9e.html" title="记录ABAP开发的日常——SAP_PO同步接口开发案例">记录ABAP开发的日常——SAP_PO同步接口开发案例</a><time datetime="2022-01-20T13:35:00.000Z" title="发表于 2022-01-20 21:35:00">2022-01-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/posts/8beb8acd.html" title="记录ABAP开发的日常——标准程序模板"><img data-lazy-src="https://gitee.com/zyhcs/image/raw/master/20210304160604.jpg" onerror='this.onerror=null,this.src="/blog/img/404.jpg"' alt="记录ABAP开发的日常——标准程序模板"></a><div class="content"><a class="title" href="/blog/posts/8beb8acd.html" title="记录ABAP开发的日常——标准程序模板">记录ABAP开发的日常——标准程序模板</a><time datetime="2021-03-02T22:50:00.000Z" title="发表于 2021-03-03 06:50:00">2021-03-03</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/posts/efbf26c8.html" title="记录ABAP开发的日常——功能函数"><img data-lazy-src="https://gitee.com/zyhcs/image/raw/master/20210304160604.jpg" onerror='this.onerror=null,this.src="/blog/img/404.jpg"' alt="记录ABAP开发的日常——功能函数"></a><div class="content"><a class="title" href="/blog/posts/efbf26c8.html" title="记录ABAP开发的日常——功能函数">记录ABAP开发的日常——功能函数</a><time datetime="2021-03-02T05:50:00.000Z" title="发表于 2021-03-02 13:50:00">2021-03-02</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/posts/8d3bbb71.html" title="记录ABAP开发的日常——常用日期函数"><img data-lazy-src="https://gitee.com/zyhcs/image/raw/master/20210228142122.jpg" onerror='this.onerror=null,this.src="/blog/img/404.jpg"' alt="记录ABAP开发的日常——常用日期函数"></a><div class="content"><a class="title" href="/blog/posts/8d3bbb71.html" title="记录ABAP开发的日常——常用日期函数">记录ABAP开发的日常——常用日期函数</a><time datetime="2021-03-01T00:32:11.000Z" title="发表于 2021-03-01 08:32:11">2021-03-01</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/blog/posts/93481df2.html" title="butterfly主题标签插件——Tag Plugin Plus"><img data-lazy-src="https://gitee.com/zyhcs/image/raw/master/dongman-3.jpg" onerror='this.onerror=null,this.src="/blog/img/404.jpg"' alt="butterfly主题标签插件——Tag Plugin Plus"></a><div class="content"><a class="title" href="/blog/posts/93481df2.html" title="butterfly主题标签插件——Tag Plugin Plus">butterfly主题标签插件——Tag Plugin Plus</a><time datetime="2021-02-28T16:57:11.000Z" title="发表于 2021-03-01 00:57:11">2021-03-01</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2022 By ZyhCs</div><div class="footer_custom_text">Hi, welcome to my <a href="https://zyhcs.gitee.io/blog">blog</a>!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">简</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"></div></div></div><hr><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/blog/js/utils.js"></script><script src="/blog/js/main.js"></script><script src="/blog/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script>function panguFn(){"object"==typeof pangu?pangu.autoSpacingPage():getScript("https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js").then(()=>{pangu.autoSpacingPage()})}function panguInit(){GLOBAL_CONFIG_SITE.isPost&&panguFn()}document.addEventListener("DOMContentLoaded",panguInit)</script><script src="/blog/js/search/local-search.js"></script><script>var preloader={endLoading:()=>{document.body.style.overflow="auto",document.getElementById("loading-box").classList.add("loaded")},initLoading:()=>{document.body.style.overflow="",document.getElementById("loading-box").classList.remove("loaded")}};window.addEventListener("load",preloader.endLoading())</script><div class="js-pjax"><script>if(window.MathJax)MathJax.startup.document.state(0),MathJax.texReset(),MathJax.typeset();else{window.MathJax={loader:{source:{"[tex]/amsCd":"[tex]/amscd"}},tex:{inlineMath:[["$","$"],["\\(","\\)"]],tags:"ams"},options:{renderActions:{findScript:[10,t=>{for(const e of document.querySelectorAll('script[type^="math/tex"]')){const a=!!e.type.match(/; *mode=display/),n=new t.options.MathItem(e.textContent,t.inputJax[0],a),s=document.createTextNode("");e.parentNode.replaceChild(s,e),n.start={node:s,delim:"",n:0},n.end={node:s,delim:"",n:0},t.math.push(n)}},""],addClass:[200,()=>{document.querySelectorAll("mjx-container:not([display='true']").forEach(t=>{const e=t.parentNode;e.classList.contains("has-jax")||e.classList.add("mathjax-overflow")})},"",!1]}}};const t=document.createElement("script");t.src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js",t.id="MathJax-script",t.async=!0,document.head.appendChild(t)}</script><script>document.getElementsByClassName("mermaid").length&&(window.mermaidJsLoad?mermaid.init():getScript("https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js").then(()=>{window.mermaidJsLoad=!0,mermaid.initialize({theme:"default"}),mermaid.init()}))</script><script>function loadValine(){function e(){let e={el:"#vcomment",appId:"f05VNWs1jpaDIrceIX470ywy-MdYXbMMI",appKey:"0zL7bvdCHiNd6nnBHUs4tTnk",placeholder:"快来发表你的意见吧！&lt;－biubiu－⊂(`ω´∩)",avatar:"monsterid",meta:"nick,mail,link".split(","),pageSize:"10",lang:"zh-CN",recordIP:!0,serverURLs:"",emojiCDN:"",emojiMaps:"",enableQQ:!0,path:window.location.pathname,master:"d4e7????4d361ad7????44a14e9e2a94".split(","),friends:"5c?????bfe6rfc72a????e268ad3819c,7c?????bfe65fc02a????e2????3919c".split(","),tagMeta:"博主,小伙伴,访客".split(",")};e.requiredFields="nick,mail".split(",");new Valine(e)}"function"==typeof Valine?e():getScript("https://cdn.jsdelivr.net/gh/HCLonely/Valine@latest/dist/Valine.min.js").then(e)}{function loadOtherComment(){loadValine()}btf.loadComment(document.getElementById("vcomment"),loadValine)}</script></div><script src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.17.0/js/md5.min.js"></script><script>window.addEventListener("load",()=>{const e=(e,t)=>{if(e)return e;return"https://gravatar.loli.net/avatar/"+(md5(t.toLowerCase())+"?d=monsterid")},t=e=>{let t="";if(e.length)for(let a=0;a<e.length;a++){t+="<div class='aside-list-item'>";{const n="data-lazy-src";t+=`<a href='${e[a].url}' class='thumbnail'><img ${n}='${e[a].avatar}' alt='${e[a].nick}'></a>`}t+=`<div class='content'>\n        <a class='comment' href='${e[a].url}'>${e[a].content}</a>\n        <div class='name'><span>${e[a].nick} / </span><time datetime="${e[a].date}">${btf.diffDate(e[a].date,!0)}</time></div>\n        </div></div>`}else t+="没有评论";let a=document.querySelector("#card-newest-comments .aside-list");a.innerHTML=t,window.lazyLoadInstance&&window.lazyLoadInstance.update(),window.pjax&&window.pjax.refresh(a)},a=()=>{if(document.querySelector("#card-newest-comments .aside-list")){const a=saveToLocal.get("valine-newest-comments");a?t(JSON.parse(a)):fetch("https://f05VNWs1.api.lncldglobal.com/1.1/classes/Comment?limit=6&order=-createdAt",{method:"GET",headers:{"X-LC-Id":"f05VNWs1jpaDIrceIX470ywy-MdYXbMMI","X-LC-Key":"0zL7bvdCHiNd6nnBHUs4tTnk","Content-Type":"application/json"}}).then(e=>e.json()).then(a=>{const n=a.results.map((function(t){return{avatar:e(t.QQAvatar,t.mail),content:(a=t.comment,""===a||(a=(a=(a=(a=a.replace(/<img.*?src="(.*?)"?[^\>]+>/gi,"[图片]")).replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi,"[链接]")).replace(/<pre><code>.*?<\/pre>/gi,"[代码]")).replace(/<[^>]+>/g,"")).length>150&&(a=a.substring(0,150)+"..."),a),nick:t.nick,url:t.url+"#"+t.objectId,date:t.updatedAt};var a}));saveToLocal.set("valine-newest-comments",JSON.stringify(n),10/1440),t(n)}).catch(e=>{document.querySelector("#card-newest-comments .aside-list").innerHTML="无法获取评论，请确认相关配置是否正确"})}};a(),document.addEventListener("pjax:complete",a)})</script><div class="app-refresh" id="app-refresh"><div class="app-refresh-wrap"><label>✨ 網站已更新最新版本 👉</label> <a href="javascript:void(0)" onclick="location.reload()">點擊刷新</a></div></div><script>function showNotification(){if(GLOBAL_CONFIG.Snackbar){var t="light"===document.documentElement.getAttribute("data-theme")?GLOBAL_CONFIG.Snackbar.bgLight:GLOBAL_CONFIG.Snackbar.bgDark,e=GLOBAL_CONFIG.Snackbar.position;Snackbar.show({text:"已更新最新版本",backgroundColor:t,duration:5e5,pos:e,actionText:"點擊刷新",actionTextColor:"#fff",onActionClick:function(t){location.reload()}})}else{var o=`top: 0; background: ${"light"===document.documentElement.getAttribute("data-theme")?"#49b1f5":"#1f1f1f"};`;document.getElementById("app-refresh").style.cssText=o}}"serviceWorker"in navigator&&(navigator.serviceWorker.controller&&navigator.serviceWorker.addEventListener("controllerchange",(function(){showNotification()})),window.addEventListener("load",(function(){navigator.serviceWorker.register("/sw-template.js")})))</script><script async src="//at.alicdn.com/t/font_2264842_3izu8i5eoc2.js"></script><script defer src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script><script defer src="https://cdn.jsdelivr.net/npm/hexo-theme-volantis@latest/source/js/issues.min.js"></script><canvas class="fireworks" mobile="false"></canvas><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/fireworks.min.js"></script><script defer id="ribbon" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-ribbon.min.js" size="150" alpha="0.6" zindex="-1" mobile="false" data-click="true"></script><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful=!0,POWERMODE.shake=!0,POWERMODE.mobile=!1,document.body.addEventListener("input",POWERMODE)</script><script src="https://cdn.jsdelivr.net/npm/pjax/pjax.min.js"></script><script>let pjaxSelectors=["title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax"];var pjax=new Pjax({elements:'a:not([target="_blank"]):not([href="/music/"]):not([href="/no-pjax/"])',selectors:pjaxSelectors,cacheBust:!1,analytics:!1,scrollRestoration:!1});document.addEventListener("pjax:complete",(function(){window.refreshFn(),document.querySelectorAll("script[data-pjax]").forEach(e=>{const t=document.createElement("script"),o=e.text||e.textContent||e.innerHTML||"";Array.from(e.attributes).forEach(e=>t.setAttribute(e.name,e.value)),t.appendChild(document.createTextNode(o)),e.parentNode.replaceChild(t,e)}),GLOBAL_CONFIG.islazyload&&window.lazyLoadInstance.update(),"function"==typeof chatBtnFn&&chatBtnFn(),"function"==typeof panguInit&&panguInit(),"function"==typeof gtag&&gtag("config","",{page_path:window.location.pathname}),"function"==typeof loadMeting&&document.getElementsByClassName("aplayer").length&&loadMeting(),"object"==typeof Prism&&Prism.highlightAll(),"object"==typeof preloader&&preloader.endLoading()})),document.addEventListener("pjax:send",(function(){if("object"==typeof preloader&&preloader.initLoading(),window.aplayers)for(let e=0;e<window.aplayers.length;e++)window.aplayers[e].options.fixed||window.aplayers[e].destroy();"object"==typeof typed&&typed.destroy();const e=document.body.classList;e.contains("read-mode")&&e.remove("read-mode")})),document.addEventListener("pjax:error",e=>{404===e.request.status&&pjax.loadUrl("/404.html")})</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>